﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApplication1.Models
{
    //去除字符串中的空白字符后进行比较两字符串是否相等
    public class TrimStringEqualityComparer:IEqualityComparer<string>
    {
        public bool Equals(string x, string y)
        {
            string xtmp = x.Trim();
            string ytmp = y.Trim();
            if (xtmp == ytmp)
                return true;
            else
                return false;
        }

        public int GetHashCode(string obj)
        {
            return obj.GetHashCode();
        }
    }
}